﻿using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System.Linq;

public class ToggleSelect : MonoBehaviour
{
    public Toggle toggle1;
    public Toggle toggle2;
    public Toggle toggle3;
    public ToggleGroup group;

    // Use this for initialization
    void Start()
    {
        toggle2.onValueChanged.AddListener(OnValueChangeCallBack);
        group.SetAllTogglesOff();
        toggle2.isOn = true;

    }

    void OnValueChangeCallBack(bool toggle)
    {
        Debug.Log("<color=red>"+group.ActiveToggles().FirstOrDefault().name + " select:" + toggle+"</color>");
    }
}
